#include <iostream>
#include <cstring>
#include <unistd.h>

static const int NUM = 103;
static const char HEAD = '>';
static const char BODY = '=';
static const char* lable = "|/-\\";

void process()
{
    char buff[NUM];
    memset(buff, 0, sizeof(buff));
    int cnt = 0;
    int n = strlen(lable);
    buff[0] = HEAD;
    while(cnt <= 100)
    {
        printf("[%-100s][%3d%%][%c]\r", buff, cnt, lable[cnt % n]);
        fflush(stdout);
        buff[cnt++] = BODY;
        if(cnt < 100)
            buff[cnt] = HEAD;
        ::usleep(50000);
    }
}


